//	items:内容，格式为{}
//	container:节点ID
//	defaultValue: 初始值
//	width: 下拉菜单高度
//	onCommand:选择后的返回函数

$.login = $.Class();
$.extend($.login.prototype, {
	options: {
		name: null,
		pwd: null,
		sumbit: null,
		info:null
	},

	sos: function (os) {
		$.extend($.extend(this, this.options), os);
	},

	initialize: function (options) {
		this.sos(options);
		this.iD();
		this.iE();
	},

	iD: function () {
		this.name = $("#" + this.name);
		this.pwd = $("#" + this.pwd);
		this.sumbit = $("#" + this.sumbit);
		this.info = $("#" + this.info);
	},

	iE: function () {
		this.oSCH = this.onSumbitClick.proxy(this);
		this.sumbit.bind('click', this.oSCH);
	},

	dD: function () {
		this.name = null;
		this.pwd = null;
		this.sumbit = null;
		this.info = null;
	},

	dE: function () {
		$(document).unbind('click', this.oBCH);
	},

	close: function () {
		this.dE();
		this.dD();
	},
	onSumbitClick: function (e) {
		this.login();
	},
	login:function(){
		var name = this.name.val();
		var pwd = this.pwd.val();
		$.system.login({
			name:name,
			pwd:pwd
		});
	},
	callback:function(json){
		if(json.code = "OK0000"){
			$.system.fire(json.data);
		}
//		$.system.event.fire("login","ok");
	}
});